package com.chunfen.tomcat.designpattern;

public class NoQuarterState extends State {

    NoQuarterState(GumballMachine gumballMachine){
        this.gumballMachine = gumballMachine;
    }

    @Override
    protected void insertQuarter() {
        System.out.println("You inserted a quarter");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    protected void ejectQuarter() {
        System.out.println("You haven't inserted a quarter");
    }

    @Override
    protected void turnCrank() {
        System.out.println("You turned, but there's no quarter");
    }

    @Override
    protected void dispense() {
        System.out.println("You need to pay first");
    }
}
